﻿using FreeSql.DataAnnotations;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace NoSqlTest.Model
{
    /// <summary>
    /// 中间表（学生-课程）
    /// </summary>
    public class MiddleStudentCourse
    {
        [FreeSql.DataAnnotations.Column(IsIdentity = true, IsPrimary = true)]//FreeSql
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//Sugar
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]  //Ef设置自增(int类型默认自增)
        public int Id { get; set; }
        public int CourseId { get; set; }
        [SugarColumn(IsIgnore = true)]
        public virtual Course Course { get; set; }
        public int StudentId { get; set; }
        [SugarColumn(IsIgnore = true)]
        public virtual Student Student { get; set; }
    }
}
